<template>
  <div class="hrDataBox">
    <div class="container">
      <div class="row" v-for="(row, rowIndex) in 2" :key="rowIndex">
        <div class="column" v-for="(col, colIndex) in 2" :key="colIndex">
          <div class="innerDataCard">
            <img src="../assets/images/zj1.png" alt="" />
            <div class="info">Row {{ rowIndex + 1 }}, Column {{ colIndex + 1 }} with long text</div>
          </div>
        </div>
      </div>
    </div>
  </div>
  <div class="centerCircle">
    <div v-html="svgString" class="svgBox"></div>
  </div>
</template>

<script lang="ts" setup>
import { ref, defineProps } from "vue";
import { svgData } from "../assets/images/svgData";

const middleText = ref("市场");
const svgString = svgData(middleText.value);

defineProps({
  data: {
    type: Object as any,
    default: () => ({})
  }
});
</script>

<style lang="scss" scoped>
.hrDataBox {
  position: relative;
  width: 100%;
  height: 100%;
  background: url("../assets/images/hrCardBg.png") no-repeat center center;
  background-size: cover;
}
.centerCircle {
  position: absolute;
  top: 57%;
  left: 50%;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: calc(100% - 60px);
  text-align: center;
  transform: translate(-50%, -50%);
}
.svgBox {
  cursor: pointer;
  transform: scale(1.1);
}
.container {
  display: flex;
  flex-direction: column;
  gap: 50px;
  padding: 10px;
}
.row {
  display: flex;
  gap: 180px;
  justify-content: space-between;
}
.column {
  flex: 1;
  width: calc(50% - 25px); // 考虑到gap的一半
}
.innerDataCard {
  box-sizing: border-box;
  display: flex;
  flex-direction: row;
  align-items: center;
  width: 100%;
  height: 85px; // 固定高度，根据需要调整
  padding: 10px;
  background-color: transparent;
}
.info {
  display: -webkit-box;
  width: 100%;
  height: 60px; // 固定高度，根据需要调整
  margin-top: 0;
  overflow: hidden;
  color: #ffffff;
  text-align: center;
  text-overflow: ellipsis;
  word-wrap: break-word;
  -webkit-line-clamp: 3; // 显示行数，根据需要调整
  -webkit-box-orient: vertical;
}
img {
  max-width: 100%;
  max-height: 120px; // 根据需要调整
  object-fit: contain;
  filter: brightness(1.5); // 调整亮度值来加深颜色，1.0 表示原始亮度
}
</style>
